<!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <title>分类管理</title>
</head>

<body>

<!--中间-->

<div class="admin-content-container padded-nomal ">

    <div class="ui container">

        <div class="ui success message" th:unless="${#strings.isEmpty(msg)}">
            <i class="close icon"></i>
            <div class="header">提示：</div>
            <p th:text="${msg}">操作成功！</p>
        </div>
        <div class="ui error message" th:unless="${#strings.isEmpty(errormsg)}">
            <i class="close icon"></i>
            <div class="header">提示：</div>
            <p th:text="${errormsg}">操作失败！</p>
        </div>

        <table class="ui table">
            <thead>
            <tr>
                <th>序号</th>
                <th>名称</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item,iterStat : ${page.list}">
                <td th:text="${iterStat.count}">1</td>
                <td th:text="${item.name}">菜菜的kuls</td>

                <td>

                    <a th:href="@{/admin/types/{id}/update(id=${item.id})}" class="ui mini blue button">编辑</a>
                    <a th:href="@{/admin/types/{id}/delete(id=${item.id})}" class="ui mini red button">删除</a>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <th colspan="6">
                    <div class="ui mini right floated pagination menu" th:unless="${page.pages}==1">
                        <a th:href="@{/admin/types/(pageNum=${page.pageNum}-1)}" th:unless="${page.isFirstPage}"
                           class="icon item">
                            <i class="left chevron icon"></i>
                        </a>
                        <a th:each="p : ${page.navigatepageNums}" th:text="${p}"
                           th:href="@{/admin/types/(pageNum=${p})}"
                           class="item">1</a>

                        <a th:href="@{/admin/types/(pageNum=${page.pageNum}+1)}" th:unless="${page.isLastPage}"
                           class="icon item">
                            <i class="right chevron icon"></i>
                        </a>
                    </div>

                    <a th:href="@{/admin/types/input}" class="ui right floated black button"><i
                            class="ui add icon"></i>新增</a>
                </th>
            </tr>
            </tfoot>
        </table>


    </div>


</div>
<div class="ui small modal" style="width: 800px !important; height: 200px!important;">
    <div class="header">Header</div>
    <div class="content">
        <iframe class="iframeMain" th:src="@{/admin/main}" frameborder="0" style="width: 100%; height:100%"
                data-id="/admin/main"></iframe>

    </div>
</div>
</body>


<!-- 页面jQuery.js的引用位置问题,如果导入了其它与jquery有关的js文件,那么jquery.js须在其它js的前面 -->
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/semantic.min.js}"></script>
<script th:src="@{/js/main.js}"></script>

<script>


    $("#menu-btn").click(function () {
        $(".menu-item").toggleClass("mobile-hide")
    });

    //下拉菜单
    $('#dropdownmenu').dropdown({
        on: 'hover'
    });

    //类型选择    
    $('.ui.selection.dropdown')
        .dropdown({
            maxSelections: 3
        })
    ;
    //消息关闭
    $('.message .close')
        .on('click', function () {
            $(this).closest('.message').transition('fade');
        });
</script>
</body>
</html>